import request from '@/utils/request'

// 获取分类列表
export function getCategoryList(params) {
  return request({
    url: '/api/category/list',
    method: 'get',
    params
  })
}

// 获取分类分页列表
export function getCategoryPage(params) {
  return request({
    url: '/api/category/page',
    method: 'get',
    params
  })
}

// 新增分类
export function saveCategory(data) {
  return request({
    url: '/api/category',
    method: 'post',
    data
  })
}

// 更新分类
export function updateCategory(data) {
  return request({
    url: '/api/category',
    method: 'put',
    data
  })
}

// 删除分类
export function deleteCategory(id) {
  return request({
    url: `/api/category/${id}`,
    method: 'delete'
  })
}


export function getCategoryDetail(id) {
  return request({
    url: '/api/category/'+ id,
    method: 'get'
  })
}
